package com.naiterui.ehp.bs.b2c.product.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 商品品类表
 *
 * @author zhoupeipei
 * @date 2019-05-17 14:41
 * @since 1.0.0
 */
@Data
@Entity
@NoArgsConstructor
@Table(name = "p_sku")
public class Sku implements Serializable {
    private static final long serialVersionUID = 4861315665119992447L;

    /**
     * 状态(0:下架，1:正常)
     */
    public static final int STATUS_DOWN = 0;
    public static final int STATUS_UP = 1;

    /**
     * 是否默认SKU 是
     */
    public static final int DEFAULT_SKU_YES = 0;
    /**
     * 是否默认SKU 否
     */
    public static final int DEFAULT_SKU_NO = 1;
    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    /**
     * 商品id
     */
    @Column(name = "product_id")
    private Long productId;

    /**
     * 规格编码
     */
    @Column(name = "number")
    private String number;

    /**
     * 是否默认  0：是  1：否
     */
    @Column(name = "default_sku")
    private Integer defaultSku;

    /**
     * sku名称（商品名 通用名 规格）
     */
    @Column(name = "name")
    private String name;

    /**
     * 包装规格(0.25g*12片*2板/盒)
     */
    @Column(name = "packing_spec")
    private String packingSpec;

    /**
     * 单位包装规格数量（24）
     */
    @Column(name = "packing_unit_number")
    private Integer packingUnitNumber;

    /**
     * 规格单位（板）
     */
    @Column(name = "spec_unit")
    private String specUnit;

    /**
     * 规格值
     */
    @Column(name = "spec_value")
    private Integer specValue;

    /**
     * 售价(分)
     */
    @Column(name = "sale_price")
    private Integer salePrice;

    /**
     * 累计售出
     */
    @Column(name = "total_sale")
    private Long totalSale;

    /**
     * 重量(克)
     */
    @Column(name = "weight")
    private Integer weight;

    /**
     * 状态(0:下架，1:正常)
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 库存预警值
     */
    @Column(name = "inventory_warning_value")
    private Integer inventoryWarningValue;

    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 创建人
     */
    @Column(name = "created_by")
    private String createdBy;

    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;

    /**
     * 修改人
     */
    @Column(name = "changed_by")
    private String changedBy;

    /**
     * 乐观锁
     */
    @Version
    @Column(name = "version")
    private Integer version;

    /**
     * 默认用法用量：0.未配置 1.已配置
     */
    @Column(name = "default_usage")
    private Integer defaultUsage;

    /**
     * 安全用法用量：0.未配置 1.已配置
     */
    @Column(name = "safe_usage")
    private Integer safeUsage;

    /**
     * 最后配置时间
     */
    @Column(name = "last_config_time")
    private Date lastConfigTime;

}
